home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / truncate.z / truncate
Encoding:
Text File  |  2002-10-03  |  9.9 KB  |  199 lines

  1.  
  2.  
  3.  
  4. TTTTRRRRUUUUNNNNCCCCAAAATTTTEEEE((((2222))))                                                        TTTTRRRRUUUUNNNNCCCCAAAATTTTEEEE((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee, _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee, _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444, _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444 - set a file to a specified
  10.      length
  11.  
  12. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_nnnn_iiii_ssss_tttt_dddd_...._hhhh_>>>>
  14.  
  15.      _iiii_nnnn_tttt _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_p_a_t_h_,,,, _oooo_ffff_ffff______tttt _l_e_n_g_t_h_))))_;;;;
  16.  
  17.      _iiii_nnnn_tttt _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee _((((_iiii_nnnn_tttt _f_i_l_d_e_s_,,,, _oooo_ffff_ffff______tttt _l_e_n_g_t_h_))))_;;;;
  18.  
  19.      _iiii_nnnn_tttt _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444 _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_p_a_t_h_,,,, _oooo_ffff_ffff_6666_4444______tttt _l_e_n_g_t_h_))))_;;;;
  20.  
  21.      _iiii_nnnn_tttt _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444 _((((_iiii_nnnn_tttt _f_i_l_d_e_s_,,,, _oooo_ffff_ffff_6666_4444______tttt _l_e_n_g_t_h_))))_;;;;
  22.  
  23. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.      The file whose name is given by _p_a_t_h or referenced by the descriptor
  25.      _f_i_l_d_e_s has its size set to _l_e_n_g_t_h bytes.
  26.  
  27.      If the file was previously longer than _l_e_n_g_t_h, bytes past _l_e_n_g_t_h will no
  28.      longer be accessible.  If it was shorter, bytes from the EOF before the
  29.      call to the EOF after the call will be read in as zeros.  The effective
  30.      user ID of the process must have write permission for the file, and for
  31.      _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee and _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444 the file must be open for writing.
  32.  
  33.      The only difference between the regular routines and the *64 routines is
  34.      that _l_e_n_g_t_h is a 64-bit value for the *64 routines, allowing files longer
  35.      than 2 gigabytes in size to be truncated.  This is relevant only on
  36.      certain filesystem types.
  37.  
  38.      _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee and _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444 fail if one or more of the following are true:
  39.  
  40.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS            Search permission is denied on a component of the path
  41.                        prefix.
  42.  
  43.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS            Write permission is denied for the file referred to by
  44.                        _p_a_t_h.
  45.  
  46.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN            The file exists, mandatory file/record locking is set,
  47.                        and there are outstanding record locks on the file [see
  48.                        _cccc_hhhh_mmmm_oooo_dddd(2)].  This restriction is not currently enforced.
  49.  
  50.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT            _p_a_t_h points outside the process's allocated address
  51.                        space.
  52.  
  53.      _EEEE_FFFF_BBBB_IIII_GGGG             An attempt is made to write a file that exceeds the
  54.                        process's file size limit or the maximum file size [see
  55.                        _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2) and _uuuu_llll_iiii_mmmm_iiii_tttt(2)].
  56.  
  57.      _EEEE_IIII_NNNN_TTTT_RRRR             A signal was caught during execution of the _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee or
  58.                        _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444 routine.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTRRRRUUUUNNNNCCCCAAAATTTTEEEE((((2222))))                                                        TTTTRRRRUUUUNNNNCCCCAAAATTTTEEEE((((2222))))
  71.  
  72.  
  73.  
  74.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL            _p_a_t_h is not an ordinary file.
  75.  
  76.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL            _l_e_n_g_t_h is less than zero.
  77.  
  78.      _EEEE_IIII_OOOO               An I/O error occurred while reading from or writing to
  79.                        the file system.
  80.  
  81.      _EEEE_IIII_SSSS_DDDD_IIII_RRRR            The file referred to by _p_a_t_h is a directory.
  82.  
  83.      _EEEE_LLLL_OOOO_OOOO_PPPP             Too many symbolic links were encountered in translating
  84.                        _p_a_t_h.
  85.  
  86.      _EEEE_NNNN_AAAA_MMMM_EEEE_TTTT_OOOO_OOOO_LLLL_OOOO_NNNN_GGGG      The length of a _p_a_t_h component exceeds {NAME_MAX}
  87.                        characters, or the length of _p_a_t_h exceeds {PATH_MAX}
  88.                        characters.
  89.  
  90.      _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT            Either a component of the path prefix or the file
  91.                        referred to by _p_a_t_h does not exist.
  92.  
  93.      _EEEE_NNNN_OOOO_TTTT_DDDD_IIII_RRRR           A component of the path prefix of _p_a_t_h is not a
  94.                        directory.
  95.  
  96.      _EEEE_RRRR_OOOO_FFFF_SSSS             The file referred to by _p_a_t_h resides on a read-only
  97.                        file system.
  98.  
  99.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT         The object of the write is located on a remote system
  100.                        which is not available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  101.  
  102.      _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee and _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444 fail if one or more of the following are true:
  103.  
  104.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN            The file exists, mandatory file/record locking is set,
  105.                        and there are outstanding record locks on the file [see
  106.                        _cccc_hhhh_mmmm_oooo_dddd(2)].  This restriction is not currently enforced.
  107.  
  108.      _EEEE_BBBB_AAAA_DDDD_FFFF             _f_i_l_d_e_s is not a file descriptor open for writing.
  109.  
  110.      _EEEE_FFFF_BBBB_IIII_GGGG             An attempt is made to write a file that exceeds the
  111.                        process's file size limit or the maximum file size [see
  112.                        _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2) and _uuuu_llll_iiii_mmmm_iiii_tttt(2)].
  113.  
  114.      _EEEE_IIII_NNNN_TTTT_RRRR             A signal was caught during execution of the _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee
  115.                        or _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee_6666_4444 routine.
  116.  
  117.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL            _l_e_n_g_t_h is less than zero.
  118.  
  119.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL            _f_i_l_d_e_s does not correspond to an ordinary file.
  120.  
  121.      _EEEE_IIII_OOOO               An I/O error occurred while reading from or writing to
  122.                        the file system.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTRRRRUUUUNNNNCCCCAAAATTTTEEEE((((2222))))                                                        TTTTRRRRUUUUNNNNCCCCAAAATTTTEEEE((((2222))))
  137.  
  138.  
  139.  
  140.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT         The object of the write is located on a remote system
  141.                        which is not available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  142.  
  143. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  144.      _ffff_cccc_nnnn_tttt_llll(2), _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2), _oooo_pppp_eeee_nnnn(2)
  145.  
  146. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  147.      Upon successful completion, a value of 0 is returned.  Otherwise, a value
  148.      of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error.
  149.  
  150. BBBBUUUUGGGGSSSS
  151.      Partial blocks discarded as the result of truncation are not zero filled;
  152.      this can result in holes in files which do not read as zero.
  153.  
  154.      These calls should be generalized to allow ranges of bytes in a file to
  155.      be discarded.
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.